package api

import (
	"github.com/gin-gonic/gin"
	"monitoring-api/service"
)

func GetStatInfo(c *gin.Context) {
	var service service.StatLogsInfoService
	if err := c.ShouldBind(&service); err == nil {
		res := service.Stat()
		c.JSON(200, res)
	} else {
		c.JSON(500, gin.H{
			"message": err.Error(),
		})
	}
}

func GetGraph(c *gin.Context) {
	var service service.GetGraphService
	if err := c.ShouldBind(&service); err == nil {
		res := service.Query()
		c.JSON(200, res)
	} else {
		c.JSON(500, gin.H{
			"message": err.Error(),
		})
	}
}
